package constants

const (

	// 法币汇率
	CommonCnyRateKey = "common:rate:cny:%s"

	// --------------------------------

	// spider:bit-z:tickers:eth_btc
	TickerExchangeKey = "spider:%s:tickers:%s"

	// 交易所币种
	SpiderSymbolCoinKey = "spider:%s:symbols:coins"
	// 交易所交易对
	SpiderSymbolPairKey = "spider:%s:symbols:pairs"

	// K线
	// spider:bit-z:kline:1min:symbol:eth_btc
	SpiderKlineLastTimeKey = "spider:%s:kline:%s:last:%s"
	SpiderKlineSymbolKey = "spider:%s:kline:%s:symbol:%s:%d"
	SpiderKlineListKey = "spider:%s:kline:%s:list:%s"

	// CoinMarketCap Data
	// cmc:coin:market:btc
	CmcCoinMarketInfoKey = "cmc:coin:market:%s"

	// cmc:coin:quote:btc:USD
	CmcCoinQuoteInfoKey = "cmc:coin:quote:%s:%s"

	// 交易所24小时交易量
	CmcExchangeVolume24hKey = "cmc:exchange:volume_24h:%s:%s"

	// 交易所交易对信息[hash]
	// cmc:exchange:pairs:bit-z
	CmcExchangePairKey = "cmc:exchange:pair:symbols:%s"

	// 交易所交易对24小时交易量
	// cmc:exchange:pair:volume_24h:bit-z:eth_btc:BTC
	CmcExchangePairVolume24hKey = "cmc:exchange:pair:volume_24h:%s:%s:%s"

	// -------------------------

	// analysis:exchange:sort:pair:bit-z:price:asc/desc
	AnalysisPairSortKey = "analysis:exchange:sort:pair:%s:%s:%s"

	// 保存交易所按成交量排序计算的结果
	// asc/desc
	AnalysisExchangeVolumeSortKey = "analysis:exchange:sort:amount:%s"

	// 交易所交易对 ticker， 添加了USD价格分析
	AnalysisExchangeTickerKey = "analysis:exchange:ticker:%s:%s"

	// 各交易所交易区
	AnalysisExchangeMarketKey = "analysis:exchange:coin:%s:market:coin"

	// 各交易所所有交易对
	AnalysisExchangeCoinKey = "analysis:exchange:coin:%s:symbol:coin"

	// 保存每个交易所币种的价格
	AnalysisCoinUsdPriceKey = "analysis:exchange:coin:%s:price:%s"

	// 交易所元数据
	AnalysisExchangeBaseKey = "analysis:exchange:meta:%s"

	// 交易所总成交量
	AnalysisExchangeVolumeKey = "analysis:exchange:volume:%s"

	// 按 market value 市值排序
	// mv price percent
	// asc / desc
	AnalysisCoinSortAscKey = "analysis:coin:sort:%s:%s"

	// 分析数据
	// 基础数据，没有的时候才保存，固定不变
	AnalysisCoinBaseKey = "analysis:coin:meta:%s"

	// analysis:coin:ticker:usdt
	AnalysisCoinTickerKey = "analysis:coin:ticker:%s"

	// 该币种在哪个交易所会出现
	// set 类型
	// analysis:coin:exchange:usdt:binance
	AnalysisCoinInExchange = "analysis:coin:exchange:%s:%s"

	// 排序，获取24小时之前的最后价格以得到涨跌幅
	// analysis:cion:sort:usdt
	AnalysisCoinTimePriceMapKey = "analysis:coin:percent:%s:map"

	// 保存时间戳，用有序集合，值和分数都用时间戳，获取某个时间
	// 然后再从另一个Hash类型中的找出该时间戳对应的价格
	// 会起一个定时器，定期从这两个组合中删除数据
	AnalysisCoinTimeSortKey = "analysis:coin:percent:%s:ts"

	// ---------------------------------------
	// analysis:kline:coin:usdt:1min:detail:<time>
	// analysis:kline:coin:usdt:1min:list:list
	AnalysisKlineCoinListKey = "analysis:kline:coin:%s:%s:list"
	AnalysisKlineCoinDetailKey = "analysis:kline:coin:%s:%s:detail"

	// 队列
	AnalysisKlineCoinQueueKey = "analysis:kline:coin:queue"

	// analysis:kline:pair:bit-z:eth_btc:1min:detail
	AnalysisKlinePairDetailKey = "analysis:kline:pair:%s:%s:%s:detail"
)